﻿// <copyright file="MainViewModel.cs" company="Golizza.net">Copyright (c) 2012 All Right Reserved</copyright>

namespace Sharemarker.BinaryOptionApplication.ViewModels
{
    using System.Collections.ObjectModel;

    using Sharemarker.BinaryOptionApplication.Models;
    using Sharemarker.Common.Framework;

    /// <summary>
    /// The view model for MainWindow.
    /// </summary>
    public class MainViewModel : NotifyPropertyChangedBase
    {
        #region [ Private Fields ]

        /// <summary>
        /// The back up value for <see cref="CurrencyPairs"/> property.
        /// </summary>
        private ObservableCollection<CurrencyPair> currencyPairs;

        /// <summary>
        /// The back up value for <see cref="CurrentPair"/> property.
        /// </summary>
        private CurrencyPair currentPair;

        /// <summary>
        /// The back up value for <see cref="TimeFrame"/> property.
        /// </summary>
        private TimeFrame timeFrame;

        /// <summary>
        /// The back up value for <see cref="ForexSites"/> property.
        /// </summary>
        private ObservableCollection<ForexSite> forexSites;

        #endregion

        #region [ Properties ]

        /// <summary>
        /// Gets or sets the CurrencyPairs.
        /// </summary>
        public ObservableCollection<CurrencyPair> CurrencyPairs
        {
            get
            {
                return this.currencyPairs;
            }

            set
            {
                if (this.currencyPairs != value)
                {
                    this.currencyPairs = value;
                    this.OnPropertyChanged("CurrencyPairs");
                }
            }
        }

        /// <summary>
        /// Gets or sets the CurrentPair.
        /// </summary>
        public CurrencyPair CurrentPair
        {
            get
            {
                return this.currentPair;
            }

            set
            {
                if (this.currentPair != value)
                {
                    this.currentPair = value;
                    this.OnPropertyChanged("CurrentPair");
                }
            }
        }

        /// <summary>
        /// Gets or sets the TimeFrame.
        /// </summary>
        public TimeFrame TimeFrame
        {
            get
            {
                return this.timeFrame;
            }

            set
            {
                if (this.timeFrame != value)
                {
                    this.timeFrame = value;
                    this.OnPropertyChanged("TimeFrame");
                }
            }
        }

        /// <summary>
        /// Gets the ForexSite collection.
        /// </summary>
        public ObservableCollection<ForexSite> ForexSites
        {
            get
            {
                return this.forexSites ?? (this.forexSites = new ObservableCollection<ForexSite>());
            }
        }

        #endregion
    }
}
